var express = require('express');
var execFile = require('child_process').execFile
var router = express.Router();
const path = require('path');
/* GET home page. */
router.get('/', function (req, res, next) {
  
    execFile(path.resolve(__dirname, './sh/gitBase.sh'),{encoding:'utf8'},function (err,stdout,stderr){
        if (err){
            console.log(err);
            return;
        }
        res.send('执行成功1');
    });
});
router.get('/set', function (req, res, next) {
    execFile(path.resolve(__dirname, './sh/gitServe.sh'),{encoding:'utf8'},function (err,stdout,stderr){
        if (err){
            console.log(err);
            return;
        }
        res.send('执行成功2');
    });
});
module.exports = router;